@extends('Admin.layout.layout')
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>菜单管理</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                        <form action="/foradmin/menu" method="GET">
                            <div class="col-sm-12">
                                <a class="btn-sm btn-primary" href="/foradmin/menu/create">添加</a>
                            </div>
                        </form>
                        </div>
                        <table class="table table-striped table-bordered table-hover dataTable" id="editable">
                            <thead>
                                <tr>
                                    <th width="15">
                                        <input type="checkbox" class="checkall" name="selectall" />
                                    </th>
                                    <th>ID</th>
                                    <th>菜单名称</th>
                                    <th>描述</th>
                                    <th>创立时间</th>
                                    <th>修改时间</th>
                                    <th class="center">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                
                                @if(!empty($list))
                                    @foreach($list as $value)
                                    <tr class="gradeX">
                                        <th>
                                            <input type="checkbox" class="checkall" name="checkBox" />
                                        </th>
                                        <td>{{array_get($value, 'menu_id')}}</td>
                                        <td><span class="{{ array_get($value,'icon') }}"> {{array_get($value, 'name')}}</span></td>
                                        <td>{{array_get($value, 'description')}}</td>
                                        <td>{{array_get($value, 'created_at')}}</td>
                                        <td>{{array_get($value, 'updated_at')}}</td>
                                        <td class="center">
                                            <a class="btn btn-xs btn-warning" href="/foradmin/menu/{{$value['menu_id']}}/edit">编辑</a>
                                            <button class="btn btn-xs btn-danger"
                                                    data-url="{{URL::to('foradmin/menu/'.$value['menu_id'])}}"
                                                    data-toggle="modal"
                                                    data-target="#delete-modal"
                                            >
                                                删除
                                            </button>
                                        </td>
                                    </tr>
                                    @endforeach
                                @else
                                    <tr class="no-records-found center"><td colspan="8">没有找到匹配的记录</td></tr>
                                @endif
                            </tbody>
                        </table>
                        <div class="row">
                            @include('Admin.common.paginate', ['page' => $page])
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section("after.js")
    @include('Admin.components.modal.delete',['title'=>'操作提示','content'=>'你确定要删除这个菜单吗?'])
@endsection
